/**
 * Copyright (c) 2015-2018, Golly Hu 胡高 (3722711@qq.com).
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.hg.jfsa.web.service.api;

import java.util.List;
import java.util.Map;

import com.jfinal.plugin.activerecord.Page;

import cn.hg.jfsa.model.News;
import cn.hg.jfsa.model.Service;
import cn.hg.jfsa.model.ServiceCategory;

/**
 * 类 {@code ServiceServiceApi} 服务服务层接口.
 * <p>
 * 主要包括 取得服务分类列表、获取服务分页、获取服务等功能
 *
 * @author <a href="mailto:3722711@qq.com">Golly</a>
 *
 * @since 2018/12/12
 */
public interface ServiceServiceApi {

	/**
	 * 取得下一个服务
	 *
	 * @param id
	 *
	 * @return
	 */
	News getNextService (int id, Map<String, Object> paraMap);

	/**
	 * 取得上一个服务
	 *
	 * @param id
	 *
	 * @return
	 */
	News getPrevService (int id, Map<String, Object> paraMap);

	/**
	 * 获取服务
	 *
	 * @param id
	 *            服务ID
	 *
	 * @return 服务实例
	 */
	Service getService (int id);

	/**
	 * 取得服务分类列表
	 *
	 * @param paraMap
	 *            参数Map：
	 *            <ul>
	 *            <li>code （可选）分类代码</li>
	 *            <li>id （可选）分类ID</li>
	 *            </ul>
	 *
	 * @return 分类List
	 */
	List<ServiceCategory> getServiceCategoryList (Map<String, Object> paraMap);

	/**
	 * @param paraMap
	 *
	 * @return
	 */
	List<Service> getServiceList (Map<String, Object> paraMap);

	/**
	 * 获取服务分页
	 *
	 * @param page
	 *            页数
	 * @param size
	 *            条数
	 * @param paraMap
	 *            参数Map：
	 *            <ul>
	 *            <li>categoryId （可选）分类ID</li>
	 *            <li>title （可选）标题，模糊查询</li>
	 *            <li>keyword （可选）关键字，模糊查询</li>
	 *            <li>categoryCode （可选）分类代码</li>
	 *            <li>categoryName （可选）分类名，模糊查询</li>
	 *            </ul>
	 *
	 * @return 服务Page对象
	 */
	Page<Service> getServicePage (int page, int size, Map<String, Object> paraMap);

}
